<template>
  <div>
    <div class="first-title">404 Page Not Found</div>
    <div class="second-title">访问的页面不存在,将在{{time}}秒后返回首页</div>
  </div>
</template>

<script>
  export default {
    name: "NotFount",
    mounted() {
      let timer = setInterval(() => {
        this.time !== 0 ? this.time-- : clearInterval(timer)
      }, 1000)
    },
    watch: {
      time(val) {
        if (val === 0){
          this.$store.userId ? this.$router.push('/page/user/manager') : this.$router.push('/login')
        }
      }
    },
    data() {
      return {
        time: 3
      }
    }
  }
</script>

<style scoped>
  .first-title {
    width: 500px;
    height: 50px;
    font-size: 42px;
    line-height: 50px;
    text-align: center;
    margin: 100px auto;
  }

  .second-title {
    width: 700px;
    height: 40px;
    font-size: 36px;
    line-height: 40px;
    text-align: center;
    margin: 20px auto;
  }

</style>
